<?php
$company = getUserLoggedIn();
$activePage = constant("__ACTIVE_PAGE__");

if (!in_array($activePage, Array("login", "register"))){
	if (isset($company)){
		$company->profile = new CompanyProfileInfo($company->profileInfoId);
		$companyMessage = new CompanyMessages();
		$company->messages = $companyMessage->search('`companyId` = '.$company->id);		
	}else{
		header("location: login.php");
	}	
}
?>
